<?php
	require_once($_SERVER['DOCUMENT_ROOT']."/classes/Account.class.php");
	require_once($_SERVER['DOCUMENT_ROOT']."/includes/sugar.php");
	session_start();
	$account = new Account();
	if($account->login($_POST['mailConnect'],$_POST['password']) < 0){
		$array['errMess'] = getErrMess(6);
		$array['status'] = 0;
	}
	else
	{
		$array['errMess'] = getErrMess(7);
		$array['link'] = "http://".$_SERVER['SERVER_NAME']."/index.php?module=myaccount";
		$array['status'] = 1;
	}
	echo json_encode($array);
?>